package com.example.ioc.controller;


import com.example.ioc.component.UserComponent;
import com.example.ioc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Controller;

@Controller
public class HelloController {

//    @Autowired
    private UserService userService;
    private UserComponent userComponent;



//    public HelloController() {
//    }
//    public HelloController(UserService userService) {
//        this.userService = userService;
//    }
//    @Autowired
//    public HelloController(UserService userService, UserComponent userComponent) {
//        this.userService = userService;
//        this.userComponent = userComponent;
//    }



    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }


    public void sayHi(){
        userService.doService();
//        userComponent.doComponent();
        System.out.println("hi, helloController");
    }
}
